import Vue from 'vue'

//组件
import Index from '@/page/index/index'
import Login from '@/page/login/login'


import List from '@/page/list/munelist'
import Munedetail from '@/page/list/Munedetail'

//土地档案
import Landmune from '@/page/land/landmune'
import LandArchiveslist from '@/page/land/landArchives/landArchiveslist'
import LandArchivesdetail from '@/page/land/landArchives/landArchivesdetail'

import LandIdlelist from '@/page/land/landIdle/landIdlelist'
import LandIdledetail from '@/page/land/landIdle/LandIdledetail'



//资产信息
import Assetsmune from '@/page/assets/assetsmune'

import AssetsInventorylist from '@/page/assets/AssetsInventory/AssetsInventorylist'
import AssetsInventorydetail from '@/page/assets/AssetsInventory/AssetsInventorydetail'

import CarInventorylist from '@/page/assets/CarInventory/CarInventorylist'
import CarInventorydetail from '@/page/assets/CarInventory/CarInventorydetail'


//房产档案
import Leasemune from '@/page/lease/leasemune'
import HouseArchiveslist from '@/page/lease/HouseArchives/HouseArchiveslist'
import HouseArchivesdetail from '@/page/lease/HouseArchives/HouseArchivesdetail'

import RetailArchiveslist from '@/page/lease/RetailArchives/RetailArchiveslist'
import RetailArchivesdetail from '@/page/lease/RetailArchives/RetailArchivesdetail'

import WareHouseArchiveslist from '@/page/lease/WareHouseArchives/WareHouseArchiveslist'
import WareHouseArchivesdetail from '@/page/lease/WareHouseArchives/WareHouseArchivesdetail'

import EscrowHouseArchiveslist from '@/page/lease/EscrowHouseArchives/EscrowHouseArchiveslist'
import EscrowHouseArchivesdetail from '@/page/lease/EscrowHouseArchives/EscrowHouseArchivesdetail'


import WorkHouseArchiveslist from '@/page/lease/WorkHouseArchives/WorkHouseArchiveslist'
import WorkHouseArchivesdetail from '@/page/lease/WorkHouseArchives/WorkHouseArchivesdetail'

import LieHouseArchiveslist from '@/page/lease/LieHouseArchives/LieHouseArchiveslist'
import LieHouseArchivesdetail from '@/page/lease/LieHouseArchives/LieHouseArchivesdetail'

import PeelHouseArchiveslist from '@/page/lease/PeelHouseArchives/PeelHouseArchiveslist'
import PeelHouseArchivesdetail from '@/page/lease/PeelHouseArchives/PeelHouseArchivesdetail'

import OtherHouseArchiveslist from '@/page/lease/OtherHouseArchives/OtherHouseArchiveslist'
import OtherHouseArchivesdetail from '@/page/lease/OtherHouseArchives/OtherHouseArchivesdetail'

import TemporaryHouseArchiveslist from '@/page/lease/TemporaryHouseArchives/TemporaryHouseArchiveslist'
import TemporaryHouseArchivesdetail from '@/page/lease/TemporaryHouseArchives/TemporaryHouseArchivesdetail'
//房屋租赁
import Housemune from '@/page/house/housemune'

import RentalInfolist from '@/page/house/RentalInfo/RentalInfolist'
import RentalInfodetail from '@/page/house/RentalInfo/RentalInfodetail'

import RentCompletelist from '@/page/house/RentComplete/RentCompletelist'
import RentCompletedetail from '@/page/house/RentComplete/RentCompletedetail'

//内容页展示区域
const root = Vue.component('root', {
  template: '<router-view></router-view>'
});

let routes = [
  { 
    path: '/',
    name: 'Login',
    component: Login,
    meta: {
      hidden: true
    }
  }, {
    path: '/',
    component: root,
    meta: {
      requiresAuth: true
    },
    children: [{
      path: 'index',
      name: 'Index',
      component: Index,
     },
     {//房屋租赁
      path: 'housemune',
      name: 'Housemune',
      component: Housemune,
     },{//出租信息
      path: 'rentalInfolist',
      name: 'RentalInfolist',
      component: RentalInfolist,
     },{
      path: 'RentalInfodetail',
      name: 'RentalInfodetail',
      component:RentalInfodetail,
     },
     ,{//完成出租
      path: 'rentCompletelist',
      name: 'RentCompletelist',
      component: RentCompletelist,
     },{
      path: 'rentCompletedetail',
      name: 'RentCompletedetail',
      component:RentCompletedetail,
     },
     {/****************固定资产************/
      path: 'assetsmune',
      name: 'Assetsmune',
      component: Assetsmune,
     },{//资产信息
      path: 'assetsInventorylist',
      name: 'AssetsInventorylist',
      component: AssetsInventorylist,
     },{
      path: 'assetsInventorydetail',
      name: 'AssetsInventorydetail',
      component:AssetsInventorydetail,
     },{//车辆信息
      path: 'carInventorylist',
      name: 'CarInventorylist',
      component: CarInventorylist,
     },{
      path: 'carInventorydetail',
      name: 'CarInventorydetail',
      component:CarInventorydetail,
     },
      {/****************房产档案************/
      path: 'leasemune',
      name: 'Leasemune',
      component: Leasemune,
     }, {//房产档案
      path: 'houseArchiveslist',
      name: 'HouseArchiveslist',
      component: HouseArchiveslist,
     },{
      path: 'houseArchivesdetail',
      name: 'HouseArchivesdetail',
      component:HouseArchivesdetail,
     },{//门市卖场档案
      path: 'retailArchiveslist',
      name: 'RetailArchiveslist',
      component: RetailArchiveslist,
     },{
      path: 'retailArchivesdetail',
      name: 'RetailArchivesdetail',
      component:RetailArchivesdetail,
     }
     ,{//仓库
      path: 'wareHouseArchiveslist',
      name: 'WareHouseArchiveslist',
      component: WareHouseArchiveslist,
     },{
      path: 'wareHouseArchivesdetail',
      name: 'WareHouseArchivesdetail',
      component:WareHouseArchivesdetail,
     },{//代管房产
      path: 'escrowHouseArchiveslist',
      name: 'EscrowHouseArchiveslist',
      component: EscrowHouseArchiveslist,
     },{
      path: 'escrowHouseArchivesdetail',
      name: 'EscrowHouseArchivesdetail',
      component:EscrowHouseArchivesdetail,
     },{//办公场所档案
      path: 'workHouseArchiveslist',
      name: 'WorkHouseArchiveslist',
      component: WorkHouseArchiveslist,
     },{
      path: 'workHouseArchivesdetail',
      name: 'WorkHouseArchivesdetail',
      component:WorkHouseArchivesdetail,
     },{//闲置房产档案
      path: 'lieHouseArchiveslist',
      name: 'LieHouseArchiveslist',
      component: LieHouseArchiveslist,
     },{
      path: 'lieHouseArchivesdetail',
      name: 'LieHouseArchivesdetail',
      component:LieHouseArchivesdetail,
     },{//剥离房产档案
      path: 'peelHouseArchiveslist',
      name: 'PeelHouseArchiveslist',
      component: PeelHouseArchiveslist,
     },{
      path: 'peelHouseArchivesdetail',
      name: 'PeelHouseArchivesdetail',
      component:PeelHouseArchivesdetail,
     },{//其他
      path: 'otherHouseArchiveslist',
      name: 'OtherHouseArchiveslist',
      component: OtherHouseArchiveslist,
     },{
      path: 'otherHouseArchivesdetail',
      name: 'OtherHouseArchivesdetail',
      component:OtherHouseArchivesdetail,
     },{//临时房产
      path: 'temporaryHouseArchiveslist',
      name: 'TemporaryHouseArchiveslist',
      component: TemporaryHouseArchiveslist,
     },{
      path: 'temporaryHouseArchivesdetail',
      name: 'TemporaryHouseArchivesdetail',
      component:TemporaryHouseArchivesdetail,
     },
     {/****************土地档案************/
      path: 'landmune',
      name: 'Landmune',
      component: Landmune,
     },
     {//土地档案
      path: 'landArchiveslist',
      name: 'LandArchiveslist',
      component: LandArchiveslist,
     },{
      path: 'landArchivesdetail',
      name: 'LandArchivesdetail',
      component:LandArchivesdetail,
     },{//闲置土地档案
      path: 'landIdlelist',
      name: 'LandIdlelist',
      component: LandIdlelist,
     },{
      path: 'landIdledetail',
      name: 'LandIdledetail',
      component:LandIdledetail,
     },
  ]
  }
]

routes[1].children.forEach(route => {
  if (route.children) {
    if (!route.meta) {
      route.meta = {};
    }
    route.meta.children = route.children;
  }
});

export default routes;

